// 手写curry
// 参数  函数功能
// 怎么计算参数的数量收集到位
// fn.length == args.length

// 1. 参数满满来
// 2. 参数到齐就执行
// 3. 收集参数是递归
const curry = (fn,...args)=>
    args.length >= fn.length ? fn(...args) :
    (..._args)=>curry(fn,...args,..._args)

const addThreeNumber=(x,y,z)=>x+y+z 
const curriedAddThreeNumber = curry(addThreeNumber)
console.log(curriedAddThreeNumber(1)(2,3))